[codex] Structure Tailscale command failures#3257
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved Refactor that restructures Tailscale command error types into specific classes while keeping identical control flow. Includes security improvement by excluding sensitive data (stderr, auth tokens) from error messages. Well-tested with comprehensive new test cases. You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: codex <codex@users.noreply.github.com>
Dismissing prior approval to re-evaluate 311e609
Co-authored-by: codex <codex@users.noreply.github.com>
Dismissing prior approval to re-evaluate 1db0e32
Summary
Validation
vp test packages/tailscale/src/tailscale.test.ts(12 tests)vp checkvp run typecheckNote
Structure Tailscale command failures into typed error classes with sanitized context
TailscaleCommandErrorhelper with four distinctSchema.TaggedErrorClasstypes:TailscaleCommandSpawnError,TailscaleCommandOutputError,TailscaleCommandExitError, andTailscaleCommandTimeoutError, each carrying structured context (executable, subcommand, argument count, and relevant metrics).stdoutLength/stderrLengthinstead of raw stdio content, and timeout errors includetimeoutMsderived from the Duration input.TailscaleStatusParseErroris also migrated toSchema.TaggedErrorClasswith a fixed message and aDefectcause, avoiding raw error text in the message.readTailscaleStatus,ensureTailscaleServe, anddisableTailscaleServeall change; callers relying on the previous error shape or message strings will break.Macroscope summarized 1db0e32.